// Learn cc.Class:
//  - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
 
cc.Class({
    extends: cc.Component,
 
    properties: {
       toastLeb:cc.Label,
       toastBg:cc.Sprite,
    },
 
   
    show(msg,showTime){
        this.toastLeb.string=msg;
        this.node.active=true;
        this.schedule(this.hide, showTime);
    },

    hide(){
        this.node.active=false;
       
    },
    // 清理调度器
    onDestroy() {
        this.unschedule(this.hide);
    }
});
 
